import AV from '../sdk/av-core-min'
export const handleQuickLogin=(callBack)=>{
    AV.User.loginWithMiniApp().then(user => {
        console.log(user);
        let {attributes,id} = user
        attributes.userid = id
        getApp().globalData.userInfo = attributes //全局数据存储
        wx.setStorage({ //持久化存储
            key:'userInfo',
            data:attributes
        })
        if(callBack){
            callBack() //自定义callBack函数，可以确保在登录授权结束后执行
        }
        wx.showToast({
          title: '登录成功',
        })
      }).catch(console.error);
}